using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using ECommerce.Library.Web;
using eShop.Business;
using eShop.Business;

public partial class myaccount_default : SitePublicBasePage
{
    

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (SessionManager.IsUserLoggedIn)
            {
                if (SessionManager.ReturnUrl != null)
                {
                    string returnUrl = SessionManager.ReturnUrl;
                    SessionManager.ReturnUrl = null;
                    Response.Redirect(returnUrl);
                }
               
            }
            else
            {
                Response.Redirect(CustomSiteMap.Login);
            }
        }
    }

   

    protected void lnkbLogout_Click(object sender, EventArgs e)
    {
        SessionManager.LoggedUser = null;
        CookieManager.SetCookieValue(CookieManager.USER_NAME, CookieManager.USER_NAME, DateTime.Now.AddDays(-1));
        CookieManager.SetCookieValue(CookieManager.PASSWORD, CookieManager.PASSWORD, DateTime.Now.AddDays(-1));
        Response.Redirect(CustomSiteMap.Home);
    }
}
